package decorator
{
	import flash.display.Sprite;
	
	public class ReaderDecoratorExample extends Sprite
	{
		public function ReaderDecoratorExample()
		{
			var stringReader:StringReader = new StringReader("lorem ipsum\ndorlo sit sdfd");
			var wordReader:WordReader = new WordReader(stringReader);
			var lineReader:LineReader = new LineReader(stringReader);
			traceReader(stringReader);
			traceReader(wordReader);
			traceReader(lineReader);
			
		}
		public function traceReader(reader:IReader):void{
			while(reader.hasNext()){
				trace(reader.read())
			}
		}
	}
}